-
Notifications
You must be signed in to change notification settings - Fork 712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sparklines #622
Sparklines #622
Conversation
ed484ff
to
93aec34
Compare
Load string `json:"load"` | ||
Load1 string `json:"load1"` | ||
Load5 string `json:"load5"` | ||
Load15 string `json:"load15"` |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Another thought: we might want to come up with a way to deal with units - memory usage will be in bytes, but we might want to display it in bytes. Similarly, CPU in %, with min and max pegged at 0 and 100, or latency in ms, or QPS in... QPS. |
@@ -220,6 +222,48 @@ func (c *container) ports(localAddrs []net.IP) report.StringSet { | |||
return report.MakeStringSet(ports...) | |||
} | |||
|
|||
func (c *container) cpuPercentMetric() report.Metric { | |||
result := report.MakeMetric() | |||
if len(c.pendingStats) < 2 { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
74dd5d3
to
b5d9396
Compare
scale float64 | ||
}{ | ||
{docker.MemoryUsage, "Memory Usage", "%0.2f MB", 1024 * 1024.}, | ||
{docker.CPUTotalUsage, "CPU Usage", "%0.2f%%", 1.}, |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
0450a54
to
48f6b03
Compare
First two commits are pulled out into: #631 @tomwilkie @davkal , PTAL, thanks. |
{ row.value_type === 'sparkline' && <div className="node-details-table-row-value-sparkline"><Sparkline data={row.metric.samples} min={0} max={row.metric.max} first={row.metric.first} last={row.metric.last} interpolate="none" />{row.value_major}</div> } | ||
{ row.value_type === 'sparkline' && <div className="node-details-table-row-value-unit">{row.value_minor}</div> } | ||
{ row.value_type !== 'numeric' && row.value_type !== 'sparkline' && <div className="node-details-table-row-value-major truncate" title={row.value_major}>{row.value_major}</div> } | ||
{ row.value_type !== 'numeric' && row.value_type !== 'sparkline' && row.value_minor && <div className="node-details-table-row-value-minor truncate" title={row.value_minor}>{row.value_minor}</div> } |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Metric data are sent even for non-metric fields: {
"key": "Operating system",
"value_major": "darwin",
"metric": {
"samples": null,
"min": 0,
"max": 0,
"first": "0001-01-01T00:00:00Z",
"last": "0001-01-01T00:00:00Z"
}
}, This roughly doubles the response size of a node details request compared to |
34e9873
to
62783ac
Compare
I'd also add |
62783ac
to
bda3168
Compare
@davkal by "length" do you mean number of samples, timespan, or both? |
@paulbellamy whatever we can say for sure. At the minimum "Last 15 secs", even better "Last 15 sec, 1 sample/sec, min: 0.6, max: 1.8, avg: 1.2". |
824d3a4
to
7dea1f6
Compare
de528b0
to
ecd223a
Compare
@@ -43,7 +43,7 @@ $(PROBE_EXE): probe/*.go probe/docker/*.go probe/kubernetes/*.go probe/endpoint/ | |||
|
|||
ifeq ($(BUILD_IN_CONTAINER),true) | |||
$(APP_EXE) $(PROBE_EXE) $(RUNSVINIT): $(SCOPE_BACKEND_BUILD_UPTODATE) | |||
$(SUDO) docker run $(RM) -v $(shell pwd):/go/src/github.com/weaveworks/scope -e GOARCH -e GOOS \ | |||
$(SUDO) docker run $(RM) -ti -v $(shell pwd):/go/src/github.com/weaveworks/scope -e GOARCH -e GOOS \ |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Tooltip looks great! I'd still vote for smaller width, e.g. 48px. Otherwise LGTM! Well done, jsx ❤️ Paul |
if m.Last.IsZero() || t.After(m.Last) { | ||
m.Last = t | ||
} | ||
return m |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
When you're ready, I think this need to be squashed and split into 3 PRs - the plumbing (changes to report and render/ etc), the exposing of metrics in Docker and Host probe packages, and the UI work. |
00ce461
to
3b3a45c
Compare
- base load graph x-axis on data, not a hardcoded window - format memory dynamically to scale - add some tests for the immutability of metrics - use ps.List for Sample storage, so it is immutable. Have to implement custom marshalling - adding tests for report.Metrics - check the ordering of the json samples - Make the nil value for Metrics valid. - Sort samples from oldest to newest on the wire.
- basic sparklines rendering for load - Graphs are normalized so they all render on the y-axis. - Time-axis is fixed to 15-seconds, so that data fills in correctly when data is insufficient - Move load scalar behind sparkline - add title to sparklines, showing timespan, samples, etc
3b3a45c
to
95bca02
Compare
Assuming this is green, LGTM. |
Initial work on sparklines. For this, they are just an in-memory set of [timestamp, float] tuples. Merge semantics are easy, as it is just set-union with timestamp for uniqueness. Timestamps expire as reports expire.
The graphs are a bit sub-optimal, but probably good enough to be useful, so will keep relatively basic for first release.
Todo:
Potential other sparklines to add:
Threads
TCP Connections
At the moment, because we get new data every 15 seconds (and the sparklines are 15 seconds long), every 15 seconds the sparklines entirely redraw. It would be nice to smooth that out.